import 'package:flutter/material.dart';
import 'package:flutter_queen_demo/page/test0013.dart';

class Test0014 extends StatefulWidget {
  final GlobalKey? key14;
  const Test0014(this.key14,{super.key});

  @override
  State<Test0014> createState() => _Test0014State();
}

class _Test0014State extends State<Test0014> {

  @override
  void initState() {
    super.initState();
    Future.delayed(Duration(seconds: 2),(){
      // var keyContext = widget.key14?.currentState as Test0013State;
      // keyContext.dispose();

      final routeToRemove = ModalRoute.of(widget.key14!.currentContext!);
      // Remove the route from the stack
      Navigator.of(context).removeRoute(routeToRemove!);
    });


    Future.delayed(Duration(seconds: 5),(){
      Navigator.of(context).pop();
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Test0014"),
      ),
      body: Center(
        child: Text("Test0014"),
      ),
    );
  }
}
